// import Vue from 'vue'
// import App from './App.vue'
// import ElementUI from 'element-ui'
// import VueRouter from "vue-router";
// import Home from './views/Home.vue';
// import Detail from './views/Detail.vue';

// Vue.config.productionTip = false
// Vue.use(ElementUI)
// Vue.use(VueRouter)

// const routes = [
//   {
//     path:'/',
//     name: 'home',
//     component: Home
//   },
//   {
//     path:'/detail',
//     name: 'detail',
//     component: Detail
//   }
// ]

// const router = new Vue({
//   render: h => h(App),
//   mode: history,
//   routes
// }).$mount('#app')

// export default router

import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui'
import MyPlugin from './constant/module/MyPlugin'
Vue.use(ElementUI)
Vue.config.productionTip = false
Vue.use(MyPlugin)

import Home from './views/Home.vue'
import Detail from './views/Detail.vue'
import element from './views/element.vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
  {path: '/home', component: Home},
  {path: '/detail', component: Detail},
  {path: '/element', component: element},
]

const router = new VueRouter({
  routes
})

new Vue({
  el: '#app',
  router, // 引入路由
  render: h => h(App),
  beforeCreate(){
    // 全局事件总线
    Vue.prototype.$bus = this
  }
}).$mount('#app')